From 7fc2d02ad24500d3330d7a8bf02f20b4c09fd373 Mon Sep 17 00:00:00 2001 From: Stevan Earl Date: Tue, 11 Aug 2026 15:54:22 -0700 Subject: [PATCH] schema: prohibit NONE on location watches --- db/schemas/sokwedb/tables/create/watches.m4 | 3 +++ doc/src/tables/watches.m4 | 2 ++ 2 files changed, 5 insertions(+) diff --git a/db/schemas/sokwedb/tables/create/watches.m4 b/db/schemas/sokwedb/tables/create/watches.m4 index 8171b87..d3a321d 100644 --- a/db/schemas/sokwedb/tables/create/watches.m4 +++ b/db/schemas/sokwedb/tables/create/watches.m4 @@ -58,6 +58,9 @@ CREATE TABLE watches ( OR type = 'sdb_other_watch') ,notes TEXT NOT NULL notonlyspaces_check(`Notes') + ,CONSTRAINT "AnimID NONE cannot be used with a location watch" + CHECK (NOT(animid = 'sdb_no_focal' + AND type = 'sdb_location')) ); grant_priv(`WATCHES') diff --git a/doc/src/tables/watches.m4 b/doc/src/tables/watches.m4 index a02bd92..6552bb6 100644 --- a/doc/src/tables/watches.m4 +++ b/doc/src/tables/watches.m4 @@ -204,6 +204,8 @@ The |WATCHES.Type| categories are: The |WATCHES.AnimID| column contains the |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.AnimID| of the spatially located individual. + The ``sdb_no_focal`` value is not permitted because a location watch + must identify the located individual. The |WATCHES.CommID| column contains the code for the community recorded when the location was recorded in the field; the -- 2.34.1